<template>
  <a-layout class="layout">
    <a-layout-header>
      <div class="logo" />
      <a-menu
        v-model:selectedKeys="selectedKeys"
        theme="dark"
        mode="horizontal"
       :style="{ lineHeight: '64px' }"
       @click="changeKey"
      >
        <a-menu-item   v-for="item,index in navList" :key="index">{{item.name}}</a-menu-item>
      </a-menu>
    </a-layout-header>
    <a-layout-content style="padding: 0 50px">
      <a-breadcrumb style="margin: 16px 0">
      </a-breadcrumb>
      <div :style="{ background: '#fff', padding: '24px', minHeight: '560px',textAlign:'center' }">
        <component :is="navList[selectedKeys[0]]['value']"></component>
      </div>
    </a-layout-content>
    <a-layout-footer style="text-align: center">
      Ant Design ©2018 Created by Ant UED
    </a-layout-footer>
  </a-layout>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import Change from './components/Change.vue'
import Detail from './components/Detail.vue'
import Program from './components/Program.vue'
const navList = ref([
  {name:"修改绑定",value:Change},
  {name:"插件下载",value:Detail},
  {name:"常见问题",value:Program}
])
const key = ref(0)
const changeKey = ({ item, key, keyPath }) => {
  console.log(item,key,keyPath)
}
const selectedKeys = ref([0]);
</script>
<style scoped>
.site-layout-content {
  min-height: 280px;
  padding: 24px;
  background: #fff;
}
#components-layout-demo-top .logo {
  float: left;
  width: 120px;
  height: 31px;
  margin: 16px 24px 16px 0;
  background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl #components-layout-demo-top .logo {
  float: right;
  margin: 16px 0 16px 24px;
}

[data-theme='dark'] .site-layout-content {
  background: #141414;
}
</style>
